package com.minimalist.common.entity.basic.vo.user;

import com.minimalist.common.config.swagger.SchemaEnum;
import com.minimalist.common.entity.basic.enums.UserEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import java.util.Objects;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author 11987
 */

@Schema(name = "用户设置实体")
public class UserSettingVO implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    @NotBlank(message = "用户昵称不能为空")
    @Schema(name = "nickname", description = "用户昵称", type = "string")
    private String nickname;

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    @NotBlank(message = "用户真实姓名不能为空")
    @Schema(name = "userRealName", description = "用户真实姓名", type = "string")
    private String userRealName;

    public String getUserRealName() {
        return userRealName;
    }

    public void setUserRealName(String userRealName) {
        this.userRealName = userRealName;
    }

    @NotBlank(message = "手机号不能为空")
    @Schema(name = "phone", description = "手机号码", type = "string")
    private String phone;

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Schema(name = "email", description = "用户邮箱，可为空", type = "string")
    private String email;

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @NotNull(message = "用户性别不能为空")
    @SchemaEnum(implementation = UserEnum.UserSex.class)
    @Schema(name = "userSex", description = "用户性别", type = "integer")
    private Integer userSex;

    public Integer getUserSex() {
        return userSex;
    }

    public void setUserSex(Integer userSex) {
        this.userSex = userSex;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserSettingVO that = (UserSettingVO) o;
        return Objects.equals(nickname, that.nickname) &&
               Objects.equals(userRealName, that.userRealName) &&
               Objects.equals(phone, that.phone) &&
               Objects.equals(email, that.email) &&
               Objects.equals(userSex, that.userSex);
    }

    @Override
    public int hashCode() {
        return Objects.hash(nickname, userRealName, phone, email, userSex);
    }

    @Override
    public String toString() {
        return "UserSettingVO{" +
               "nickname='" + nickname + '\'' +
               ", userRealName='" + userRealName + '\'' +
               ", phone='" + phone + '\'' +
               ", email='" + email + '\'' +
               ", userSex=" + userSex +
               '}';
    }
}
